﻿@using ZDSoft.LMS.Domain;
@model TransportOrder
@{
    ViewBag.Title = "接单";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<table border="0" cellpadding="0" cellspacing="0" style="width: 100%; background-color: White;"
    align="center">
    <tr>
        <td class="mbg">
            <table cellspacing="0" cellpadding="0" width="100%" border="0" valign="top">
                <tr>
                    <td>
                        <table style="height: 23px;" cellspacing="0" cellpadding="0" width="120" background="@Url.Content("~/Content/Images/m_17.gif")"
                            border="0">
                            <tr>
                                <td>
                                    <span class="contentPageTitle">&nbsp;&gt;&gt; 新建货物运单</span>
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr>
                    <td align="right" class="titleContentDivider" height="6">
                    </td>
                </tr>
            </table>
        </td>
    </tr>
</table>
<p>
    @Html.ActionLink("返回列表", "Index")
</p>
<link href="@Url.Content("~/Content/Style/CreateTranportOrder.css")" rel="stylesheet" type="text/css" />
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
<script type="text/javascript" language="javascript">
    $(document).ready(function () {
        SetDeliveryType("1"); //设置运输方式的默认值（站到站）
    });
    function SetDeliveryType(id) {
        $("#deliveryTypeId").val(id);
    }
</script>
<div>
    @using (Html.BeginForm())
    {
        @Html.ValidationSummary(true)
        <div>
            <table class="transportOrderTable" border="0" width="100%" cellpadding="0" cellspacing="0">
                <tr>
                    <td width="70">
                        发站：
                    </td>
                    <td colspan="2">
                        @Html.EditorFor(Model => Model.StartStation)
                    </td>
                    <td>
                        到站：
                    </td>
                    <td colspan="5">
                        @Html.EditorFor(Model => Model.Destionation)
                    </td>
                </tr>
                <tr>
                    <td colspan="2">
                        到站所属省（市）自治区
                    </td>
                    <td colspan="5">
                        @Html.DropDownListFor(model => model.ProvinceID, new SelectList(ViewBag.ProvinceList, "ID", "Name"), "------请选择-----")
                        @Html.ValidationMessageFor(model => model.ID)
                    </td>
                    <td rowspan="6">
                        <span>运输方式</span>
                    </td>
                    <td rowspan="6" colspan="2">
                        <span>站到站</span>
                        <input type="radio" id="1" name="S" checked="checked" onclick="SetDeliveryType('1')" /><br />
                        <span>门到站</span>
                        <input type="radio" id="2" name="S" onclick="SetDeliveryType('2')" /><br />
                        <span>门到门</span>
                        <input type="radio" id="3" name="S" onclick="SetDeliveryType('3')" /><br />
                        <span>站到门</span>
                        <input type="radio" id="4" name="S" onclick="SetDeliveryType('4')" />
                    </td>
                </tr>
                <tr>
                    <td>
                        <span>发货地点</span>
                    </td>
                    <td colspan="3">
                        @Html.EditorFor(Mode => Model.StartStationLocation)
                    </td>
                    <td>
                        <span>交货地点</span>
                    </td>
                    <td colspan="2">
                        @Html.EditorFor(Model => Model.DeliveryLocation)
                    </td>
                </tr>
                <tr>
                    <td rowspan="2">
                        <span>托运人</span>
                    </td>
                    <td>
                        <span>名称</span>
                    </td>
                    <td colspan="3">
                        @Html.EditorFor(Model => Model.Commisionedor.Name)
                    </td>
                    <td>
                        <span>电话</span>
                    </td>
                    <td>
                        @Html.EditorFor(Model => Model.Commisionedor.Telephone)
                    </td>
                </tr>
                <tr>
                    <td>
                        <span>地址</span>
                    </td>
                    <td>
                        @Html.EditorFor(Model => Model.Commisionedor.Address)
                    </td>
                    <td>
                        <span>邮编</span>
                    </td>
                    <td>
                        @Html.EditorFor(Model => Model.Commisionedor.PostNumber)
                    </td>
                    <td>
                        <span>E-mail</span>
                    </td>
                    <td>
                        @Html.EditorFor(Model => Model.Commisionedor.Email)
                    </td>
                </tr>
                <tr>
                    <td rowspan="2">
                        <span>收货人</span>
                    </td>
                    <td>
                        <span>名称</span>
                    </td>
                    <td colspan="3">
                        @Html.EditorFor(Model => Model.Receiver.Name)
                    </td>
                    <td>
                        <span>电话</span>
                    </td>
                    <td>
                        @Html.EditorFor(Model => Model.Receiver.Telephone)
                    </td>
                </tr>
                <tr>
                    <td>
                        <span>地址</span>
                    </td>
                    <td>
                        @Html.EditorFor(Model => Model.Receiver.Address)
                    </td>
                    <td>
                        <span>邮编</span>
                    </td>
                    <td>
                        @Html.EditorFor(Model => Model.Receiver.PostNumber)
                    </td>
                    <td>
                        <span>E-mail</span>
                    </td>
                    <td>
                        @Html.EditorFor(Model => Model.Receiver.Email)
                    </td>
                </tr>
                <tr>
                    <td colspan="2">
                        货物品名
                    </td>
                    <td>
                        集装箱箱型
                    </td>
                    <td>
                        集装箱箱类
                    </td>
                    <td>
                        集装箱数量
                    </td>
                    <td>
                        集装箱号码
                    </td>
                    <td>
                        施封号码
                    </td>
                    <td colspan="2">
                        运输费用
                    </td>
                </tr>
                <tr>
                    <td colspan="2">
                        @Html.TextBoxFor(Model => Model.TranportOrderItems[0].CargoName, new { @class="cargoTextWidth" })
                    </td>
                    <td>
                        @Html.TextBoxFor(Model => Model.TranportOrderItems[0].CabinetSort, new { @class = "cargoTextWidth" })
                    </td>
                    <td>
                        @Html.TextBoxFor(Model => Model.TranportOrderItems[0].CabinetType, new { @class = "cargoTextWidth" })
                    </td>
                    <td>
                        @Html.TextBoxFor(Model => Model.TranportOrderItems[0].Counter, new { @class = "cargoTextWidth" })
                    </td>
                    <td>
                        @Html.TextBoxFor(Model => Model.TranportOrderItems[0].CabinetNumber, new { @class = "cargoTextWidth" })
                    </td>
                    <td>
                        @Html.TextBoxFor(Model => Model.TranportOrderItems[0].SealedNumber, new { @class = "cargoTextWidth" })
                    </td>
                    <td colspan="2">
                        @Html.TextBoxFor(Model => Model.TranportOrderItems[0].TransportFee, new { @class = "cargoTextWidth" })
                    </td>
                </tr>
                <tr>
                    <td>
                        <span>托运人记载事项</span>
                    </td>
                    <td colspan="2">
                        @Html.EditorFor(Model => Model.CommissionedorRemark)
                    </td>
                    <td>
                        <span>添附文件</span>
                    </td>
                    <td>
                        @Html.EditorFor(Model => Model.AttachedFile)
                    </td>
                    <td>
                        <span>货物价格</span>
                    </td>
                    <td>
                        @Html.EditorFor(Model => Model.Price)
                    </td>
                    <td>
                        承运人记载事项
                    </td>
                    <td colspan="3">
                        @Html.EditorFor(Model => Model.TransportorRemark)
                    </td>
                </tr>
            </table>
        </div>
        <div>
            @Html.ValidationMessageFor(Model => Model.StartStation)
            @Html.ValidationMessageFor(Model => Model.Destionation)
            @Html.ValidationMessageFor(Model => Model.ProvinceOfDestionation.Name)
            @Html.ValidationMessageFor(Model => Model.StartStationLocation)
            @Html.ValidationMessageFor(Model => Model.DeliveryLocation)
            @Html.ValidationMessageFor(Model => Model.Commisionedor.Name)
            @Html.ValidationMessageFor(Model => Model.Commisionedor.Address)
            @Html.ValidationMessageFor(Model => Model.Commisionedor.PostNumber)
            @Html.ValidationMessageFor(Model => Model.Commisionedor.Email)
            @Html.ValidationMessageFor(Model => Model.Receiver.Name)
            @Html.ValidationMessageFor(Model => Model.Receiver.Address)
            @Html.ValidationMessageFor(Model => Model.Receiver.PostNumber)
            @Html.ValidationMessageFor(Model => Model.Receiver.Email)
            @Html.ValidationMessageFor(Model => Model.TranportOrderItems[0].CargoName)
            @Html.ValidationMessageFor(Model => Model.TranportOrderItems[0].CabinetSort)
            @Html.ValidationMessageFor(Model => Model.TranportOrderItems[0].Counter)
            @Html.ValidationMessageFor(Model => Model.TranportOrderItems[0].CabinetNumber)
            @Html.ValidationMessageFor(Model => Model.TranportOrderItems[0].SealedNumber)
            @Html.ValidationMessageFor(Model => Model.CommissionedorRemark)
            @Html.ValidationMessageFor(Model => Model.Commisionedor.Name)
            @Html.ValidationMessageFor(Model => Model.Receiver.Telephone)
            @Html.ValidationMessageFor(Model => Model.TranportOrderItems[0].CabinetType)
            @Html.ValidationMessageFor(Model => Model.TransportorRemark)
            @Html.ValidationMessageFor(Model => Model.TranportOrderItems[0].TransportFee)
        </div>
        <div>
            <input type="hidden" name="deliveryTypeId" id="deliveryTypeId" />
            <input type="submit" value="保存" class="btn3" />
        </div>
    }
</div>
